<?php
/**
 * 测试控制
 */

namespace app\index\controller;

use app\admin\model\Test as TestModel;
use think\Loader;

class Test 
{

    /**
     * 测试用例
     * @return [type] [description]
     */
    public function test()
    {
        return Loader::model('Test','model',false,'admin')->test(5, 6);
    }
    /**
     * 擦拭用例二
     * @return [type] [description]
     */
    public function testTwo()
    {
        return \app\admin\model\Test::test(5,5);
    }
    /**
     * 测试用例三
     * @return [type] [description]
     */
    public function testTree()
    {
        return \app\admin\model\Test::testTwo();
    }
    /**
     * 测试用例四    ->实例化对象访问非静态属性 
     * @return [type] [description]
     */
    public function testFour()
    {
        $Test = new \app\admin\model\Test;
        $b = $Test::$b = 10;
        return $Test->test(1, $b);
    }
    /**
     * 测试用例五  实例化对象访问静态方法
     * @return [type] [description]
     */
    public function testFive()
    {
        $TestModel = new \app\admin\model\Test;
        return $TestModel->testTwo(5,5);
    }
    /**
     * 测试用例六 
     * @return [type] [description]
     */
    public function testSix()
    {
        return TestModel::$a;
    }
    /**
     * 测试用例7
     * @return [type] [description]
     */
    public function testSeven()
    {
        $TestModel = new \app\admin\model\Test;
        return $TestModel->c;
    }
    /**
     * 测试用例八
     * @return [type] [description]
     */
    public function testEight()
    {
        return \app\admin\model\Test::$b;
    }

    public function scenicLists()
    {
        $model = new \app\common\server\Tour;
        // $id = 'S00049'; //景区ID
        // $id = '1012310024'; //联票ID
        // $orderno = '14021342271';
        // $id = 'H00010';
        // $res = $model->scenicLists('topAsc', 2, 10); //景区列表 1
        // $res = $model->scenicView("S00049");              //景区详情 1
        // $res = $model->ticketLists();                //联票列表 1
        // $res = $model->ticketView(1012310024);              //联票详情 1
        // $res = $model->orderList("zw123456",'topAsc', 1, 15);    //分页查看订单列表 1
        $res= $model->orderView(14021342271,'zw123456');             //订单详情
        // $res = $model->hotelList('admin','', "1", "20", '2014-08-15'); //获取酒店
        // $res = $model->hotelView('', $id, '');   //酒店详情

        $id = 'S00049';
        $res = \app\common\server\Tour::instance()->scenicLists();
        // $res = \app\common\server\Tour::instance()->scenicView($id);
        // $res = \app\common\server\Tour::instance()->ticketLists();
        // $arr = json_decode($res, true);

        echo($res);
    }

    public function scenicView($id)
    {
        echo \app\common\server\Tour::instance()->scenicView($id);
    }

    public function sync()
    {
        dump(model('ScenicsLoad')->sync(1));
    }

}